/* 商品容器 */
.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* 图片区域 */
.product-gallery {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.image-loader {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #f5f5f5;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 1s ease-in-out infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #f5f5f5;
}

.thumbnail-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-container::-webkit-scrollbar-thumb {
    background-color: #4CAF50;
    border-radius: 3px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
    transform: scale(1.05);
}

/* 商品信息 */
.product-info {
    padding: 25px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.product-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.product-price {
    font-size: 28px;
    color: #4CAF50;
    font-weight: bold;
    margin: 20px 0;
}

.product-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.product-description {
    color: #555;
    line-height: 1.8;
    margin-bottom: 25px;
    white-space: pre-line;
}

/* 卖家信息 */
.seller-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.seller-info:hover {
    background-color: #f0f0f0;
}

.seller-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
}

.seller-details {
    flex: 1;
}

.seller-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.seller-rating {
    color: #666;
    font-size: 14px;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.action-button {
    flex: 0 0 calc(50% - 15px);
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-button .button-icon {
    font-size: 18px;
}

.favorite-button {
    background-color: #f5f5f5;
    color: #333;
    transition: all 0.3s ease;
}

.favorite-button:hover {
    background-color: #e0e0e0;
}

.favorite-button.active {
    background-color: #ff4d4f;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
}

.favorite-button.active .button-icon {
    color: white;
    transform: scale(1.1);
    transition: all 0.3s ease;
    color: #666;
}

.favorite-button:hover {
    background-color: #e0e0e0;
}

.favorite-button.active {
    background-color: #ff4081;
    color: white;
}

.contact-button {
    background-color: #4CAF50;
    color: white;
}

.contact-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.edit-product-btn {
    background-color: #4CAF50;
    color: white;
}

.edit-product-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.upload-image-btn {
    background-color: #4CAF50;
    color: white;
}

.upload-image-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.upload-form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    justify-items: center;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: bold;
    width: 75px;
    align-self: center;
}

.form-group input,
.form-group textarea {
    width: 220px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    resize: vertical;
    height: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.save-btn {
    background-color: #4CAF50;
    color: white;
}

.save-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.cancel-btn {
    background-color: #f44336;
    color: white;
}

.cancel-btn:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

/* 评论区域 */
.comments-section {
    grid-column: 1 / -1;
    /* 跨越所有列 */
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 25px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

@media (max-width: 900px) {
    .comments-section {
        margin: 40px 20px 0;
    }
}

@media (max-width: 768px) {
    .comments-section {
        padding: 15px;
        margin: 30px 15px 0;
    }
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.comments-header h2 {
    font-size: 20px;
    color: #333;
}

.comments-count {
    font-size: 14px;
    color: #666;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-input {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 10px;
    display: block;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 80px;
    max-height: 120px;
    font-family: inherit;
    transition: all 0.2s;
    font-size: 14px;
}

@media (max-width: 768px) {
    .comment-input {
        max-width: 100%;
        margin: 0 0 10px;
    }
}

@media (max-width: 768px) {
    .comment-input {
        min-height: 60px;
        padding: 10px;
    }
}

.comment-input:focus {
    border-color: #4CAF50;
    outline: none;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-hint {
    font-size: 14px;
    color: #666;
}

.comment-submit {
    padding: 10px 25px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.comment-submit:hover {
    background-color: #45a049;
}

.comment-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
    transition: transform 0.3s;
}

.comment-item:hover {
    transform: translateY(-2px);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.comment-user {
    font-weight: 500;
    color: #4CAF50;
}

.comment-time {
    font-size: 13px;
    color: #888;
}

.comment-content {
    color: #333;
    line-height: 1.6;
    white-space: pre-line;
}

.no-comments {
    text-align: center;
    color: #888;
    padding: 20px;
}

.delete-comment {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #ff4081;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

.delete-comment:hover {
    background-color: #e03570;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.close-button {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    transition: color 0.3s;
}

.close-button:hover {
    color: #ff4081;
}

/* 消息提示 */
.message {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    text-align: center;
    display: none;
}